<?php include("inc/db_config.inc"); ?>
        <?php
if(isset($_REQUEST['pid'])){
	$pid=$_REQUEST['pid'];
    $result_arc=mysql_query("select i.id as aid,i.title,i.created,i.pubid,i.content,t.name,t.id from info as i,type as t where i.type=t.id and i.id='$pid'");
    $row_arc=mysql_fetch_array($result_arc);
    $g_title=$row_arc['title'];
    $affect_row=mysql_affected_rows();
}else{
    $g_title="页面不存在!";
}
?>
<?php 
$g_tab="index";
$g_header=""; 
$g_js='<script type="text/javascript">
var a="xiaoshan"; 
$(document).ready(function(){
 $("#cycode").click(function(){
	$("#ycode").attr("src","code.php?rand="+Math.random());
 })
})
</script>';
?>
        <?php include("header.php"); ?>
        <?php
 if(isset($_REQUEST['pid'])&&$affect_row>0){
	 $pid=$_REQUEST['pid'];
	 ?>
  
			<div class="crumb"><a href="index.php">首页</a>&gt;<a href="catalog.php?cid=<?php echo $row_arc['id']; ?>"><?php echo $row_arc['name']; ?></a>&gt;查看正文</div>
			<div class="main">
				<div class="article">
					<div class="conbox">
						<div class="cb_hd">
							<span class="cb_tl"></span>
							<span class="cb_tr"></span>
							文章正文
						</div>
						<div class="cb_bd">
							<div class="blog_info">
								<h2 class="blog_title"><?php echo $row_arc['title']; ?></h2>
								<span class="date"><?php echo $row_arc['created']; ?></span>
								<div class="blog_cont">
									<?php echo stripslashes($row_arc['content']); ?>
								</div>
								<div class="blog_meta">
                                
									<strong>类别:<?php echo $row_arc['name']; ?></strong>|<a href="#">评论(0)</a>|浏览(37)  <!-- JiaThis Button BEGIN -->
<div id="ckepop" style="display:inline-block;margin-left:10px;">
	<a class="jiathis_button_tsina"></a>
	<a class="jiathis_button_qzone"></a>
	<a class="jiathis_button_kaixin001"></a>
	<a class="jiathis_button_renren"></a>
	<a href="http://www.jiathis.com/share/?uid=892309" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank">更多</a>
</div>
<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js?uid=892309" charset="utf-8"></script>
<!-- JiaThis Button END -->
								</div>
							</div>
							<div class="comments">
								<dl>
									<dt>评论:</dt>
									<dd>
                                    <?php
                                      $result_comments=mysql_query("select * from comment where aid=$row_arc[aid]");
                                      if(mysql_num_rows($result_comments)>0){
                                      while($row_comments=mysql_fetch_array($result_comments)){
                                    ?>
										<div class="comment_item" id="comments_<?php echo $row_comments['id'];?>">
											<img class="icon" src="http://www.gravatar.com/avatar/<?php echo md5(strtolower($row_comments['email'])); ?>&r=G&s=50&d="/>
											<span><?php echo $row_comments['name'];?>@<?php echo $row_comments['post_date'];?> <a href="#">回复</a></span>
											<p>
												<?php echo $row_comments['cont'];?>
											</p>
											<div class="c"></div>
										</div>
                                        <?php }
                                        }else{?>
                                        <p>暂无评论</p>
                                        <?php }?>
									</dd>
								</dl>
								<dl>
									<dt>发表:</dt>
									<dd>
										<form class="blog_send" action="comment_submit.php" method="post">
										<p>
											<label>姓名:(*)</label>
											<input name="name" class="txt" type="text"/>
										</p>
										<p>
											<label>Email:(*)</label>
											<input name="email" class="txt" type="text"/>
										</p>
										<p>
											<label>内容:(*)</label>
											<textarea name="content" class=""></textarea>
                                            <input type="hidden" name="cid" />
                                            <input type="hidden" name="aid" value="<?php echo $pid; ?>" />
										</p>
										<p class="vtm">
											<label>验证码:(*)</label>
											<img src="code.php" id="ycode"/>  <input name="yz" size="2" type="text"/><a id="cycode" href="javascript:void(0)">这道题我不会..换一个吧</a>
										</p>
										<p>
											<button class="sub">提交评论</button>
										</p>
										</form>
									</dd>
								</dl>
							</div>
						</div>
						<div class="cb_ft"></div>
					</div>
				</div>
			</div>
            <?php }else{?>
                <div class="page_error">
                    <img src="i/i.jpg"/><br/><br/>页面不存在!<a href="index.php">回到首页</a>
                </div>
            <?php } ?>
        <?php include("footer.php"); ?>